\psset{unit=1,algebraic}
\begin{pspicture*}(-4,-1.5)(4,1.5)
\psaxes[labelFontSize=\scriptstyle,ticksize=-3pt
0,labelsep=2pt,trigLabels=true,trigLabelBase=2,dx=\psPiH,xunit=\psPi]{<->}(0,0)(-4,-1.5)(4,1.5)
\footnotesize
\psplot[linecolor=blue]{-4}{4}{cos(x)}
\rput[l](1,1.2){$f(x)=\cos x$}
\psline[linecolor=red]{|-|}(-3.1415,-1)(3.1415,-1)
\rput[b](0.5,-0.9){\color{red}$2\pi$}
\end{pspicture*}